package org.example.pms.service.impl;

import org.example.pms.domain.Patient;
import org.example.pms.domain.User;
import org.example.pms.domain.vo.PatientCaseVo;
import org.example.pms.mapper.PatientMapper;
import org.example.pms.mapper.UserMapper;
import org.example.pms.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    private PatientMapper patientMapper;


    @Override
    public List<User> test() {

        System.out.println("==========================");
        List<User> test = userMapper.test();

        return test;
    }

    @Override
    public Boolean login(User user) {
        User user1 =  userMapper.login(user.getUsername());
        if(user1 != null){
            return user.getPassword().equals(user1.getPassword());
        }
        return false;
    }

    @Override
    public List<PatientCaseVo> getPatientCase(User user) {


        return null;
    }

    @Override
    public List<PatientCaseVo> getPatientCase(Integer userId) {
        PatientCaseVo patientCaseVo = new PatientCaseVo();
        List<Patient> patients = patientMapper.selectPatientsByUid(1);


        return Collections.emptyList();
    }


}
